package Task0;

import java.util.ArrayList;
import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
        System.out.println("今晚要做什么");
        String[] strings = {"LOL","原神","游戏","抖音","睡觉"};
        Scanner sc=new Scanner(System.in);
        ArrayList al=new ArrayList<>();
        for (int i = 0; i < strings.length; i++) {
            al.add(strings[i]);
        }
        String s1= sc.next();
        for (int i = 0; i < al.size(); i++) {
            if (s1.equals(al.get(i))){
                s1.replaceAll(s1,(String) al.get(i));
            }
        }
        System.out.println(s1+", 也要好好学习");
    }
}
/*
4.已知字符串数组 String[] strings = {"LOL","原神","游戏","抖音","睡觉"};
要放学了，控制台询问今天晚上干什么？对回答结果进行键盘录入。
        如果键盘录入的内容包含string字符串数组中的内容，将此内容进行替换，
        提醒他要好好学习。*/
